package controler;


import java.util.regex.Pattern;




public class AccountCodeValidator {
	public static final String KEY_BAD_VALID = "message.validation.impossible";
	private static Pattern p = Pattern.compile("[0-9][0-9]-[0-9][0-9][0-9]", 
			   Pattern.MULTILINE);
	public void validate(Object objet) throws Exception {
		if (!p.matcher(objet.toString()).matches()) {
			throw new Exception(KEY_BAD_VALID);
		}
	}
}


